package net.ojbk.study.curriculumDesign.web.handlers.impl;

import com.sun.corba.se.spi.ior.ObjectKey;
import net.ojbk.study.curriculumDesign.beans.APIResult;
import net.ojbk.study.curriculumDesign.beans.cilentservicer.ChatSystem;
import net.ojbk.study.curriculumDesign.common.api.APICodeConstant;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("/test")
public class TestControllerImpl {

    @Autowired
    @Qualifier("chatSystem")
    ChatSystem chatSystem;

    @RequestMapping("testOk")
    @ResponseBody
    public Object testOk() {
        return APIResult.createSuccessMessage(new APICodeConstant(), "This is Ok, you can start coding.");
    }

    @RequestMapping("test1")
    public ResponseEntity<Object> test1() {
        System.out.println("123");
        return new ResponseEntity<Object>(chatSystem.getServicerList(), HttpStatus.BAD_REQUEST);
    }
}
